package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.OrderInfoBean;
import com.common.retrofit.entity.bean.PayBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class GoToJieSuanMethods extends BaseMethods {

    private static GoToJieSuanMethods m_ins = null;

    public static GoToJieSuanMethods getInstance() {
        if (m_ins == null) {
            synchronized (GoToJieSuanMethods.class) {
                if (m_ins == null) {
                    m_ins = new GoToJieSuanMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Pay/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void orderPay(Subscriber<PayBean> subscriber,
                      int uid ,
                      String hashid  ,  int  paytype ,String orderId ,String send_time,String comments) {
        Observable observable = initService().orderPay(System.currentTimeMillis()+"",
                "89e9582ef69b0bbcd2a8185963851bf5",uid,hashid,paytype,orderId,send_time,comments
        );
        toSubscribe(observable, subscriber);
    }
}
